package com.arpa.wms.scheduled.task;

import cn.hutool.http.HttpUtil;
import lombok.extern.log4j.Log4j2;

/**
 * @author liuxr
 * @date 2021年08月16日 9:27
 */
@Log4j2
public class TbTaskJob implements ScheduledTaskJob{




    private String taskCode;
    private String url;


    public TbTaskJob(String taskCode,String url){
        this.taskCode = taskCode;
        this.url = url;
    }
    /**
     * When an object implementing interface <code>Runnable</code> is used
     * to create a thread, starting the thread causes the object's
     * <code>run</code> method to be called in that separately executing
     * thread.
     * <p>
     * The general contract of the method <code>run</code> is that it may
     * take any action whatsoever.
     *
     * @see Thread#run()
     */
    @Override
    public void run() {
        log.info("淘宝定时任务启动：【{}】",taskCode);
        HttpUtil.get(url+"?code="+taskCode);
    }
}
